package com.zbest.zpay.acctrans.share.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zbest.zpay.acctrans.common.exception.AccTransRuntimeException;
import com.zbest.zpay.acctrans.dal.mapper.AccountMapMapper;
import com.zbest.zpay.acctrans.dal.model.AccountMap;
import com.zbest.zpay.acctrans.enums.biz.AcctransBizCode;
import com.zbest.zpay.acctrans.share.AccountMapService;

/**
 * Created by wenfeihu on 16/5/25.
 */
@Service("accountMapService")
public class AccountMapServiceImpl implements AccountMapService {

    @Autowired
    private AccountMapMapper accountMapMapper;

    @Override
    public AccountMap queryAccountMap(String txCd, String busTyp) {
        AccountMap accountMap = accountMapMapper.qryAccountMap(txCd, busTyp);
        if (accountMap == null) {
            throw new AccTransRuntimeException(AcctransBizCode.ACT_ACCOUNT_MAP_NOT_EXIST,
                    "会计分录不存在");
        }
        return accountMap;
    }
}
